// 题目一
/* 
setTimeout(() => {
  var a = 'hello'
  setTimeout(() => {
    var b = 'lagou'
    setTimeout(() => {
      var c = 'I ♥ U'
      console.log(a + b + c)
    }, 10)
  }, 10)
}, 10) */


// 答案
function getA(){
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      var a = 'hello'
      resolve(a)
    }, 10)
  })
}

function getB(){
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      var b = 'lagou'
      resolve(b)
    }, 10)
  })
}

function getC(){
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      var c = 'I ♥ U'
      resolve(c)
    }, 10)
  })
}

let a = '', b = '', c = ''
getA().then(value => {
  a = value
  return getB()
}).then(value => {
  b = value
  return getC()
}).then(value => {
  c = value
  console.log(a + b + c)
})